package panda.natalia.gothread.suspend.instrument;

import org.objectweb.asm.ClassReader;
import org.objectweb.asm.Label;

/**
 * a simple framework of java fiber
 *
 * @Author: scpanda2007
 * @Date: 2019/12/10 10:43
 */
public class OffsetClassReader extends ClassReader {
    OffsetClassReader(byte[] bytes) { super(bytes); }

    @Override
    protected Label readLabel(int bytecodeOffset, Label[] labels) {
        final Label ret = super.readLabel(bytecodeOffset, labels);
        ret.info = bytecodeOffset;
        return ret;
    }
}
